﻿using System.Data;
using WMS.FC.Domain.DomainObject.System;

namespace WMS.FC.Domain.Repository
{
    public interface ISystemRepository : IRepositoryBase
    {
        /// <summary>
        /// 执行SQL
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="userInfo"></param>
        /// <param name="parameters"></param>
        /// <returns></returns>
        Task<int> ExecuteNoQuery(string sql, UserInfo userInfo, Dictionary<string, object>? parameters = null);

        /// <summary>
        /// 查询SQL
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="parameterDic"></param>
        /// <param name="pagination"></param>
        /// <param name="sorter"></param>
        /// <param name="userInfo"></param>
        /// <returns></returns>
        Task<DataTable> ExecuteQuery(string sql, Dictionary<string, object>? parameterDic = null, Pagination? pagination = null, Sorter? sorter = null, UserInfo? userInfo = null);

        /// <summary>
        /// 查询行数
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="parameterDic"></param>
        /// <param name="userInfo"></param>
        /// <returns></returns>
        Task<int> ExecuteQueryCount(string sql, Dictionary<string, object>? parameterDic = null, UserInfo? userInfo = null);

        /// <summary>
        /// 查询表信息
        /// </summary>
        /// <param name="sql"></param>
        /// <param name="parameterDic"></param>
        /// <param name="userInfo"></param>
        /// <returns></returns>
        Task<DataTable?> ExecuteQuerySchema(string sql, Dictionary<string, object>? parameterDic = null, UserInfo? userInfo = null);
    }
}
